/**
 * Created with IntelliJ IDEA.
 * Description:代码块csdn
 * User: dings
 * Date: 2024-05-14
 * Time: 12:38
 */
public class Student {
    public String name;
    public int classes;
    public static int age = 20;
    public static int score;
    public Student() {
        System.out.println("构造方法被执行....");
    }

    {
        name = "小丁爱养花";
        classes = 113;
        //age = 10;
        System.out.println("实例代码块被执行....");
    }

    static {
        //classes = 8;//静态代码块中不能初始化普通成员变量  error
        age = 18;
        score = 99;
        System.out.println("静态代码块被执行.....");
    }

    public static void main(String[] args) {
        Student student1 = new Student();
        //System.out.println(student1.name);


        //Student student2 = new Student();

    }


    public static void main2(String[] args) {
        System.out.println(Student.age);
    }

    public static void main1(String[] args) {
        {
            int a = 1;
            System.out.println(a);
        }
        //System.out.println(a);
    }
}
